// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.2 OR LicenseRef-Slint-commercial

Sub := Rectangle {
    property <bool> cond;
    property <float> child_opacity: inner.opacity;
    inner := Rectangle {
        opacity: cond ? 0 : 1;
        animate opacity { duration: 1s; }
        background: green;
    }
}

TestCase := Rectangle {
    property cond <=> s.cond;
    property val <=> s.child_opacity;
    s := Sub {}
}

/*

```rust
let instance = TestCase::new().unwrap();
assert_eq!(instance.get_val(), 1.);
instance.set_cond(true);
assert_eq!(instance.get_val(), 1.);
slint_testing::mock_elapsed_time(500);
assert_eq!(instance.get_val(), 0.5);
slint_testing::mock_elapsed_time(500);
assert_eq!(instance.get_val(), 0.);

```

*/
